import Vue from 'vue'
import VueRouter from 'vue-router'
const Index = () => import(/* webpackChunkName: "Index" */ '../views')
const Login = () => import(/* webpackChunkName: "Login" */ '../views/login')
const Register = () => import(/* webpackChunkName: "Register" */ '../views/register')
const Kios = () => import(/* webpackChunkName: "Kios" */ '../views/kios')
const Invite = () => import(/* webpackChunkName: "Invite" */ '../views/invite')
const Rule = () => import(/* webpackChunkName: "Rule" */ '../views/rule')
const Test = () => import(/* webpackChunkName: "Test" */ '../views/test')

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: '根目录',
        component: Index,
        redirect: '/kios',
        children: [
            {
                path: '/kios',
                name: 'Kios',
                component: Kios
            },
            {
                path: '/invite',
                name: '邀请明细',
                component: Invite
            },
            {
                path: '/rule',
                name: '规则',
                component: Rule
            }
        ]
    },
    {
        path: '/login',
        name: '登录',
        component: Login
    },
    {
        path: '/register',
        name: '注册',
        component: Register
    },
    {
        path: '/dapp',
        name: 'dapp',
        component: Test
    }
]

const router = new VueRouter({
    mode: 'hash',
    base: process.env.BASE_URL,
    routes
})

export default router
